package com.hx.service.impl;

import com.hx.entity.Test;
import com.hx.mapper.TestMapper;
import com.hx.service.TestService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import javax.annotation.Resource;
import java.util.List;
import java.util.Map;

/**
 * <p>
 *  服务实现类
 * </p>
 *
 * @author qizhu
 * @since 2022-06-24
 */
@Service
public class TestServiceImpl extends ServiceImpl<TestMapper, Test> implements TestService {
    @Resource
    private TestMapper testMapper;
    @Override
    public List<Map<String, String>> getAllData(String tableName) {
        return testMapper.getAllData(tableName);
    }
   /* public List<Map<String, String>> getAllData(String tableName,Integer page,Integer limit) {
        return testMapper.getAllData(tableName,page,limit);
    }*/

    @Override
    public List getAssociatedQueryDataLeft(String tableNameOne, String tableNameTwo, String fieldOne, String fieldTwo) {
        return testMapper.getAssociatedQueryDataLeft(tableNameOne, tableNameTwo, fieldOne, fieldTwo);
    }

    @Override
    public String[] getAllTableName() {
        return testMapper.getAllTableName();
    }

    @Override
    public String[] getAllTableFiled(String tableName) {
        return baseMapper.getAllTableFiled(tableName);
    }


    @Override
    public void deleteByTableNames(String tableName) {
        baseMapper.deleteByTableNames(tableName);
    }

    @Override
    public void removeDataBytableName(String tableName) {
        baseMapper.removeDataBytableName(tableName);
    }

    @Override
    public List getAssociatedQueryDataRight(String tableNameOne, String tableNameTwo, String fieldOne, String fieldTwo) {
        return baseMapper.getAssociatedQueryDataRight(tableNameOne, tableNameTwo, fieldOne, fieldTwo);
    }

    @Override
    public List getAssociatedQueryData(String tableNameOne, String tableNameTwo, String fieldOne, String fieldTwo) {
        return baseMapper.getAssociatedQueryData(tableNameOne, tableNameTwo, fieldOne, fieldTwo);
    }


    @Override
    public List getTableData(String datasourceNmae) {

        return baseMapper.getTableData(datasourceNmae);
    }

    @Override
    public Test getAllTest(Integer id) {
        return baseMapper.getAllTest(id);
    }
}
